home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / DOS_UNIX.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  327 b   |  19 lines

  1. #include <dos.h>
  2. #include <time.h>
  3. main()
  4. {
  5.     struct date date;
  6.     struct time time;
  7.     time_t tunix;
  8.  
  9. /* Get date and time from DOS */
  10.     getdate(&date);
  11.     gettime(&time);
  12.  
  13. /* Convert to UNIX format */
  14.     tunix = dostounix(&date, &time);
  15.  
  16. /* Print the date and time using 'ctime' */
  17.     printf("%s\n", ctime(&tunix));
  18. }
  19.